package cn.iocoder.yudao.module.student.dal.mysql.courseintentionstudentinfo;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.student.dal.dataobject.courseintentionstudentinfo.CourseIntentionStudentInfoDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.student.controller.admin.courseintentionstudentinfo.vo.*;

/**
 * 意向学员 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface CourseIntentionStudentInfoMapper extends BaseMapperX<CourseIntentionStudentInfoDO> {

    default PageResult<CourseIntentionStudentInfoDO> selectPage(CourseIntentionStudentInfoPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CourseIntentionStudentInfoDO>()
                .eqIfPresent(CourseIntentionStudentInfoDO::getTel, reqVO.getTel())
                .eqIfPresent(CourseIntentionStudentInfoDO::getSource, reqVO.getSource())
                .eqIfPresent(CourseIntentionStudentInfoDO::getSharePeople, reqVO.getSharePeople())
                .betweenIfPresent(CourseIntentionStudentInfoDO::getTime, reqVO.getTime())
                .eqIfPresent(CourseIntentionStudentInfoDO::getCreateMan, reqVO.getCreateMan())
                .betweenIfPresent(CourseIntentionStudentInfoDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(CourseIntentionStudentInfoDO::getUpdateMan, reqVO.getUpdateMan())
                .orderByDesc(CourseIntentionStudentInfoDO::getId));
    }

    default List<CourseIntentionStudentInfoDO> selectList(CourseIntentionStudentInfoExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<CourseIntentionStudentInfoDO>()
                .eqIfPresent(CourseIntentionStudentInfoDO::getTel, reqVO.getTel())
                .eqIfPresent(CourseIntentionStudentInfoDO::getSource, reqVO.getSource())
                .eqIfPresent(CourseIntentionStudentInfoDO::getSharePeople, reqVO.getSharePeople())
                .betweenIfPresent(CourseIntentionStudentInfoDO::getTime, reqVO.getTime())
                .eqIfPresent(CourseIntentionStudentInfoDO::getCreateMan, reqVO.getCreateMan())
                .betweenIfPresent(CourseIntentionStudentInfoDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(CourseIntentionStudentInfoDO::getUpdateMan, reqVO.getUpdateMan())
                .orderByDesc(CourseIntentionStudentInfoDO::getId));
    }

}
